/* -----------------------------------------------------------------------
   See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
   ----------------------------------------------------------------------- */

////#include "ramp_filter.h"
//#include <math.h>
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include "plm_config.h"
//#include "fdk.h"
//#include "fdk_opts_ext.h"
//#include "volume.h"
////#include "C:\\AAAfiles\\Anthony\\ImageView\\ImageView\\imageview.h"
//#include "readmha_ext.h"
//#include "fftw3.h"
//#include "fdk_utils_ext.h"
//#include "MGHMtx_opts.h"
//#include "write_matrix.h"
//#define FLOOD_SCALE 100
//#define isnan(x) ((x) != (x))
//
//#define MARGIN5 5
//#define HalfCenter 65
#ifndef _INC_MATH
#define _INC_MATH
#include "math.h"

#endif

#define MARGIN 10


void marginpadding(Proj_image * cbi)
{

	for (int r=0; r<MARGIN; r++)
		for (int c=0; c<cbi->dim[0]; c++)
			cbi->img[r*cbi->dim[0]+c]=cbi->img[MARGIN*cbi->dim[0]+c];
	for (int r=cbi->dim[1]-MARGIN; r<cbi->dim[1]; r++)
		for (int c=0; c<cbi->dim[0]; c++)
			cbi->img[r*cbi->dim[0]+c]=cbi->img[(cbi->dim[1]-MARGIN-1)*cbi->dim[0]+c];

	for (int c=0; c<MARGIN; c++)
		for (int r=0; r<cbi->dim[1]; r++)
			cbi->img[r*cbi->dim[0]+c]=cbi->img[r*cbi->dim[0]+MARGIN];

	for (int c=cbi->dim[0]-MARGIN; c<cbi->dim[0]; c++)
		for (int r=0; r<cbi->dim[1]; r++)
			cbi->img[r*cbi->dim[0]+c]=cbi->img[r*cbi->dim[0]+cbi->dim[0]-MARGIN-1];

}

	